UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1G5jm5+u3VrqaApuAHSUdMJN/FIiGBuFrmKmqTtnaaM='
WHERE
key_id = '3c1d32bfbdd4b3b462c7d5a10a1d7a2d84cf75b27509bf057cbe253d8f0d7267'
AND (
token = '1G5jm5+u3VrqaApuAHSUdMJN/FIiGBuFrmKmqTtnaaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)