UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2jwFR4yXFb3Pc/PymqHgEfvEC92RUJrqCq5/DQuNZLQ='
WHERE
key_id = '30a10aeb04e37054043856359529d9c7f9be98345a2ccd31d826b8eda7913940'
AND (
token = '2jwFR4yXFb3Pc/PymqHgEfvEC92RUJrqCq5/DQuNZLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)