UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9GTmrM5ZkYmdj6PUVZTpk9EmmrC02f5iBZWVwSEqaF0='
WHERE
key_id = '2d25f8563644496043635b56fc66f186c2c524b3478c7c718dbd6aed73998e51'
AND (
token = '9GTmrM5ZkYmdj6PUVZTpk9EmmrC02f5iBZWVwSEqaF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)