UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qzRRAZnjJ6TghsRSh1aca+gct3nh4a9rYWi8/+GqfIM='
WHERE
key_id = 'cf9f1816815be6630eeaf74dddb0d4cf4c185b1ebe2047278077212d7fe57b2e'
AND (
token = 'qzRRAZnjJ6TghsRSh1aca+gct3nh4a9rYWi8/+GqfIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)