UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NzE/7ZxLOv0h/x5ogb0J2cDbNd+2etbc4vszgE9J6ag='
WHERE
key_id = '97ae9c06cba1c45d39f55de8c778e6b462b32362b7531717b1da51f1f7dfd8a7'
AND (
token = 'NzE/7ZxLOv0h/x5ogb0J2cDbNd+2etbc4vszgE9J6ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)