UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sTpzZYJon8hxV6KRvcDX18aTL8YIf27k0xXrPTT77MM='
WHERE
key_id = '1de73e0f0106c2564d7e1def27878f4c02d21952a43d7540f7caf34a67257cbd'
AND (
token = 'sTpzZYJon8hxV6KRvcDX18aTL8YIf27k0xXrPTT77MM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)