UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gJ67evbaQcoKPK12FRJcNxG7YAaqs/zbss4VKzAsjW0='
WHERE
key_id = '6c6ba4d4c5c44db6397fd82f6cb2df84cf7f00f81bed98336877dc9fb4c255d6'
AND (
token = 'gJ67evbaQcoKPK12FRJcNxG7YAaqs/zbss4VKzAsjW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)