UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eiWYnnGiKPOHR3f3p0E+tvphctnRUFuPOH+zNgE6pbI='
WHERE
key_id = 'ed418d81f72b9bc314e822d4e69eadbfe05cdf4637a9ac61a6d634c8e05d3e90'
AND (
token = 'eiWYnnGiKPOHR3f3p0E+tvphctnRUFuPOH+zNgE6pbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)