UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tWg8tJ6aKlJNv2dVNcwh/8rw21uvMIFQFdT/dCrep0Y='
WHERE
key_id = 'ed7eb96b70a380ff06309aa289d0439d10eaa61c355ef8642db95f4423851533'
AND (
token = 'tWg8tJ6aKlJNv2dVNcwh/8rw21uvMIFQFdT/dCrep0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)