UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAGafU7s8pn8uwNYGipl2wxSEAo1AEp7Ek3iJIH5FNs='
WHERE
key_id = '3004e12df126695c7e8c73c388db595b2d16262864eac7cebb0250a8e38f76a0'
AND (
token = 'yAGafU7s8pn8uwNYGipl2wxSEAo1AEp7Ek3iJIH5FNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)