UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uzg9kivPjMHL3mZi5C9Py4Y7QXy8ERjbRhf5822VN50='
WHERE
key_id = '9d104be310c75afd1fbfe01bf7aabfad90410c85ff6dab1e8bea2f12678eb01b'
AND (
token = 'Uzg9kivPjMHL3mZi5C9Py4Y7QXy8ERjbRhf5822VN50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)