UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9d9dLNp47Kp6yu/9fPp3g/MsNwmZvHWpI83jL4tH1w='
WHERE
key_id = '36cd23304e2596f9fd3ed8d1e8ba33614168eb2932cff04323811193f5963a3b'
AND (
token = '+9d9dLNp47Kp6yu/9fPp3g/MsNwmZvHWpI83jL4tH1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)