UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4yM8NT1mx6XEcvYMWWeBmc/d5VnGMsULrs32Hrw7fU='
WHERE
key_id = '04b44078b648aefe961c44892649079d68177415ec5bb807f45bafb45be7108f'
AND (
token = 's4yM8NT1mx6XEcvYMWWeBmc/d5VnGMsULrs32Hrw7fU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)