UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OONfAGhQ5BeTUf+OTTKQh6QsGa9+nad3p/PrJNdxwz4=' 
WHERE 
  key_id = '2964995c3cfb422206e4dfe1eedb6db1eb63b7fd56ec84c7bf0e9208f50a5018' 
  AND (
    token = 'OONfAGhQ5BeTUf+OTTKQh6QsGa9+nad3p/PrJNdxwz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015