UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+2wHLPmyXwIpwoQoGXbxbYyKRTueW8pTyFzBiH3GYEI='
WHERE
key_id = '81a0b2c392620c19e40b4523eb0c7e7a890cb9a6931fd1f249fd91ecfcb3fb3a'
AND (
token = '+2wHLPmyXwIpwoQoGXbxbYyKRTueW8pTyFzBiH3GYEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)