UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LCWxXghQWwA2G9GNg5ttH9M/S3QV1ivx1oDMggJXGtw='
WHERE
key_id = '7d27fe2954d861cb0287fd7714152e9e12b6c2df7609ad90d0f2aa9f1fc0c8bd'
AND (
token = 'LCWxXghQWwA2G9GNg5ttH9M/S3QV1ivx1oDMggJXGtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)