UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+DQLaf6EQbQETL1FHQKB0N4UuJTCbzRuu+oP9lcUGY8='
WHERE
key_id = '218e09ca009d880fbe649a4aff3696fab4a2fc4109ef0d677688256a11599ba6'
AND (
token = '+DQLaf6EQbQETL1FHQKB0N4UuJTCbzRuu+oP9lcUGY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)