UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ulxb0Zrzs6DWN3zrZNmA9x5SXdS9CpoP9GmUgHKIBLE='
WHERE
key_id = 'f09eec40d30436564ff820d57a9deb3912682a08c90375b18e7aa6d9d2a29689'
AND (
token = 'Ulxb0Zrzs6DWN3zrZNmA9x5SXdS9CpoP9GmUgHKIBLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)