UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x1RATbDy21LqIqmj4JHYIHzb+hq/YEjUHW9KG9Hp4Mo='
WHERE
key_id = '64b62df5d227d87e7980afdd06fc7e0ec1aa40233420bed41ca1c0c083c4161b'
AND (
token = 'x1RATbDy21LqIqmj4JHYIHzb+hq/YEjUHW9KG9Hp4Mo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)