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