UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ro0zzyegmVNpeJyZos39/doibWjJGEaTbvRNQN1tYSE='
WHERE
key_id = 'f02450a22ca78bd2b61fb6ea075a1b5dc7e6ec7a79eca274019525455848f379'
AND (
token = 'Ro0zzyegmVNpeJyZos39/doibWjJGEaTbvRNQN1tYSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)