UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BhH33Gx6pYG4xw7vwmD5bfY++VsRz/JfyuvvZ+tdA0s='
WHERE
key_id = '70f323aa24089dcabf47977039f9242703406dae956f8c1a9ce5f5f5c0815eb5'
AND (
token = 'BhH33Gx6pYG4xw7vwmD5bfY++VsRz/JfyuvvZ+tdA0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)