UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1xVOIWmCWgpS/Rqs6r3fJN4y0anFiP6G4ECflUtIkcs='
WHERE
key_id = '0dc2fa011f119a84e197338024a9de17a5f94dc58ffee7b3adb03051cd09880b'
AND (
token = '1xVOIWmCWgpS/Rqs6r3fJN4y0anFiP6G4ECflUtIkcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)