UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6P1hrwJRZVZZz7EiwlrjgWkniH9Mub+tmAQJYaiyans='
WHERE
key_id = '0e7ca9bc601e714c793413dd33c5a938c326b2ad0d383f4b90def27921f8ff34'
AND (
token = '6P1hrwJRZVZZz7EiwlrjgWkniH9Mub+tmAQJYaiyans='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)