UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MEKXVxWkaWKrxBSW2zP5RmOFFwVQUp1sTFahVxnazFw='
WHERE
key_id = '5cb9d52d7a86c33f069ad4782755f90ade57eb49b5925b0ce1c8fcd5563ee512'
AND (
token = 'MEKXVxWkaWKrxBSW2zP5RmOFFwVQUp1sTFahVxnazFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)