UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DJHa1i2P75f2Db6+eVS8077Mnbp2d4VNbzESA5UrcHg='
WHERE
key_id = '5b8a71a7f66e0a183fa65e8e3f37987d535463f648279180b1416c0b4270412b'
AND (
token = 'DJHa1i2P75f2Db6+eVS8077Mnbp2d4VNbzESA5UrcHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)