UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8wWZQFw9CiwPU9AT4SzagssIcxcqf3P6MPaiWLBzIYo='
WHERE
key_id = 'df9272e086a2501bdc6668dd68aea8f0046b90bc1dd5e86cf61bb7bd79fb8600'
AND (
token = '8wWZQFw9CiwPU9AT4SzagssIcxcqf3P6MPaiWLBzIYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)