UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T8jPzRkjhf0VC5RJoNL3MWXAgRk6rzrjoxYLo2bYstw='
WHERE
key_id = 'f7b5dd81d89fff311b3445a09c4eabc9a3061556ec9804882022ea381392080a'
AND (
token = 'T8jPzRkjhf0VC5RJoNL3MWXAgRk6rzrjoxYLo2bYstw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)