UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ti9lZx8quKUExaT+FJE3qnFZ2J5uuO9gIUkhm7wjoHo='
WHERE
key_id = '67d79ad1204f063adace8c575966800362e52a14d7ac759ea98b043ce349a586'
AND (
token = 'Ti9lZx8quKUExaT+FJE3qnFZ2J5uuO9gIUkhm7wjoHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)