UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hQdxxakGP0PjV57yVVmdyaXswhhmUrrxj2FvWap4n44='
WHERE
key_id = '123b168ec369c1099945e87f6cd6e705a9b9092ebee148eefb08c763b7be8105'
AND (
token = 'hQdxxakGP0PjV57yVVmdyaXswhhmUrrxj2FvWap4n44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)