UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/qL6Q/DZqkGzAgmw1aLhxyQ68vtKUgkpGkpcoDVinUs='
WHERE
key_id = '0d1fb16ab5937b3a9f0f587f18727b5c920b605a1911304edca6f6b9e6bc9427'
AND (
token = '/qL6Q/DZqkGzAgmw1aLhxyQ68vtKUgkpGkpcoDVinUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)