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