UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJhMQYElVzwXDPhdJLcYeHbxoZ5w7jKu5XL9TveKXbY='
WHERE
key_id = '59bbf10104123c90c2af374a17edfd20b49e6e3111c44edce92f9fbb176652bc'
AND (
token = 'MJhMQYElVzwXDPhdJLcYeHbxoZ5w7jKu5XL9TveKXbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)