UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z/Ub3DUgwNW+hfkLJ6Rfz2gKwG4/o7nfyDHzHkrAgJE='
WHERE
key_id = 'feb42bbf5d629a98846f7e8c61095c345611117bdfc7aff5d01ed3a98c0fa9d7'
AND (
token = 'Z/Ub3DUgwNW+hfkLJ6Rfz2gKwG4/o7nfyDHzHkrAgJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)