UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v+z9KkX6rI1ZjZn7UBBEjGNPjPl3ufEKySqbqVwks7c='
WHERE
key_id = 'd32d1b846af4d976032a531c4e9e06fa2e132f7be9cc962d27a8e11c081ee0a4'
AND (
token = 'v+z9KkX6rI1ZjZn7UBBEjGNPjPl3ufEKySqbqVwks7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)