UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WMMolLNUR4RGibPbg2TwKm61em6WSYtZmwgmuUEhRMk='
WHERE
key_id = 'efd9f78b02ad899f9d51399e21000ef74b5b1ad2c6964054a255431f27f3c63c'
AND (
token = 'WMMolLNUR4RGibPbg2TwKm61em6WSYtZmwgmuUEhRMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)