UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GYQIVciVIoBVJ8t0u5zxjdLX0+kWrk8eecSUg52+Z9g='
WHERE
key_id = '0537940eeb9f5bed231123a7f6efbd6bfe8d01be498102e36dd8239bf54b69ae'
AND (
token = 'GYQIVciVIoBVJ8t0u5zxjdLX0+kWrk8eecSUg52+Z9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)