UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ksa+ECmSxwtlep6GHVrgUbJJnLH0sT+L8YSZRzgoch4='
WHERE
key_id = '9658b86e90b6d7d91fa007ef424606e813da98dfed4dd121c1e08edbbe45c465'
AND (
token = 'ksa+ECmSxwtlep6GHVrgUbJJnLH0sT+L8YSZRzgoch4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)