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